From: Sam Uong Date: Mon, 6 Jun 2022 10:45:25 +0000 (+0000) Subject: screenshot: Fall back to home if Pictures directory is not available X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~319 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ea60bf4bc7770135f35bab571a7ecee473057abc;p=gnome-shell.git screenshot: Fall back to home if Pictures directory is not available GLib.get_user_special_dir() returns null if user directories are disabled. Instead of failing silently, fall back to saving screenshots in $HOME/Screenshots in that case https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5549 Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index f30884c57..a84cd0a44 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -2064,7 +2064,7 @@ function _storeScreenshot(bytes, pixbuf) { if (!disableSaveToDisk) { const dir = Gio.File.new_for_path(GLib.build_filenamev([ - GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES), + GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES) || GLib.get_home_dir(), // Translators: name of the folder under ~/Pictures for screenshots. _('Screenshots'), ]));